package com.woniuxy.Controller;

import com.woniuxy.entity.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

//@RestController
@Controller
@RequestMapping("/userController")
public class UserController {
    @GetMapping("/User")
    public String findAll(){
//        return "findAll";
        return "/index.jsp";
    }

    @PostMapping("/User")
    public String addOne(@RequestBody User user){
        return user.toString()+"post请求";
    }

    @PutMapping("/User")
    public String update(@RequestBody User user){
        return user.toString()+"put请求";
    }

    @DeleteMapping("/User/{id}")
    public String delete(@PathVariable int id){
        return "删除了这个"+id+"的用户";
    }
}
